'use strict';
const jsdom = require('jsdom');
const cheerio = require('cheerio');
const fs = require('fs');
// const { html } = require('cheerio');
// const dom = fs.readFileSync('./domhtml.html');
// const userAgent = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0';

// class www extends jsdom.ResourceLoader {
//   async fetch(url, options) {
//     console.log('url ', url);
//     const tt = await super.fetch(url, options);
//     return tt;
//   }
// }
// const resourceLoader = new www({
// //   proxy: 'http://127.0.0.1:9001',
//   strictSSL: false,
//   userAgent,
// });

// const htmldom = new (jsdom.JSDOM)(dom, { runScripts: 'dangerously',
//   url: 'https://www3.wipo.int/branddb/en/',
//   includeNodeLocations: true,
//   resources: resourceLoader });
// console.log(' htmldom.window.qk ', htmldom.window.qk, htmldom.window.document.body.qk);


const string = fs.readFileSync('./domhtml.html').toString();
console.log('string ', string);
const strs = string.split('\n');
const pks = strs.filter(str => /qk/.test(str));

console.log('pks ', pks);
